$("#btn-part1").click(function(){
  window.location.href = 'documents/';
});

$("#btn-part2").click(function(){
  window.location.href = 'documents/';
});


$("#btn-part3").click(function(){
  window.location.href = 'downloads/';
});

$("#btn-part4").click(function(){
  window.location.href = 'https://www.openatc.org.cn/demo/openatc/#/login';
});


 $(window).resize(function () {
    let width = $(window).width()
    // console.log($(window).width()); //浏览器时下窗口可视区域高度
    let marginl = (2560 - width) / 2 // 整体向左平移距离
    // console.log(marginl)

    // 1. 居中显示方案
    // 大背景图区域
    $("#u0").css('left', -marginl + 'px')
    // 开源设备四格图片
    $("#u1").css('left', (886 - marginl)  + 'px')
    $("#u2").css('left', (1369 - marginl)  + 'px')
    $("#u3").css('left', (731 - marginl)  + 'px')
    $("#u4").css('left', (1393 - marginl)  + 'px')

    // 顶部轮播图区域
    $("#u16").css('left', (790 - marginl)  + 'px')
    // $("#u8").css('left', (103 - marginl)  + 'px')
    $("#focus").css('left', (103 - marginl)  + 'px')
    $("#u20").css('left', (680 - marginl)  + 'px')
    $("#u21").css('left', (1857 - marginl)  + 'px')


    // 平台特色、定制开发hover效果区域
    $("#u22").css('left', (1300 - marginl)  + 'px')
    $("#u23").css('left', (1300 - marginl)  + 'px')
    $("#u24").css('left', (1300 - marginl)  + 'px')


    $("#u5").css('left', (680 - marginl)  + 'px')
    $("#u6").css('left', (680 - marginl)  + 'px')
    $("#u7").css('left', (680 - marginl)  + 'px')


    // 2. 整体缩放方案
    // let zoom = width / 2560
    // $(".base").css('zoom', zoom)

 });



// 首页banner轮播图
 $("#xmSlide").xmSlide({

  width: 950,

  height: 865,

  responsiveWidth:710,

  pagination: {

    effect: "fade"  //可换成"slide"

  },

  effect: {

    fade: {

      speed: 400

    }

  },

  play: {

    effect: "fade", //可换成"slide"

    interval: 3000,

    auto: true,

    pauseOnHover: true,

    restartDelay: 2500

  }

});